window.onload = function () {
    var mydiv = document.getElementById("mydiv");
    console.log(typeof mydiv);
    if (mydiv instanceof HTMLElement) {
        mydiv.addEventListener("click", function (e) {
            mydiv.classList.toggle("myfont");
        });
        console.log("是的是HTMLElement");
    }
    var input = prompt("输入姓名：");
    var mydiv1 = document.getElementById("mydiv1");
    if (mydiv1 instanceof HTMLElement) {
        mydiv1.addEventListener("click", function (e) {
            var target = e.target;
            console.log(target.textContent);
        });
        console.log("是的是HTMLElement");
    }
};
